Repository navigation
Refuse unknown collector arguments, roll up days a stopped run landed, and keep tests off the repository .env (#61) - #62
Merged
Conversation
…, and keep tests off the repository .env (#61) - Tests that spawn the PyPI country collector run it in their temporary directory, so it never loads the repository's .env. - The collector refuses arguments other than --dry-run with a usage message and exit 2, and treats npm_config_dry_run=true (from `npm run collect:pypi-countries --dry-run`) as a dry run. - When every candidate day is already fetched, --dry-run words its verdict as a prediction for the next new day; the next run bills nothing. - A run that stops on a cap, a refusal or an error after landing a day still rewrites the 30-day rollup. - The store's month-to-date total fails closed when any day of the month holds a negative or non-integer billed figure. - The month-to-date comment says the larger figure is used because either source can be stale. - The README no longer asks workflow users for Google Cloud credentials the scheduled workflow does not use. Fixes #61
…country collection The README said that any argument other than --dry-run is refused with a usage message and exit code 2. That holds for arguments given after the `--` separator. A flag given to `npm run` without it goes to npm and is not among the collector's arguments, so `npm run collect:pypi-countries --dryrun` is not refused: the collector runs a normal collection instead of a dry run. The README now limits the refusal to arguments after the `--` and says what that mistyped flag does.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request carries two commits for the PyPI country collector, its tests and the README. The first closes the seven follow-up items in #61. The second narrows the README sentence about which arguments the collector refuses.
The collector refuses any argument it receives other than
--dry-run(with npm, the arguments after the--separator) with a usage message and exit code 2, and readsnpm_config_dry_run=true(what npm sets fornpm run collect:pypi-countries --dry-runwithout the--) as a dry run. A flag given without the--goes to npm and is not among the collector's arguments, so a mistypednpm run collect:pypi-countries --dryrunis not refused and runs a normal collection; the README says so. A run that stops on a monthly cap, a byte-ceiling refusal or an error after landing at least one day still rewrites the 30-day rollup. The store's month-to-date total throws when a day of the current month holds a billed-bytes figure that is negative or not an integer. When every candidate day is already fetched, the dry run logs that the next run would bill nothing and words its verdict as a prediction for a new day of the sample's size. The two test files that spawn the PyPI country collector setcwdto their temporary directory, so the process reads a.envthere and not the one at the repository root. The README drops the step that asked workflow users to set Google Cloud credentials, since the scheduled workflow does not run the country collector.Included
Verified on this exact tree
Node 24.21.0 (
.node-versionpins 24). The installed dependencies were checked againstpackage-lock.json: 205 packages, 0 version mismatches, 30 optional packages not installed.npm run build(Next.js 16.2.7) exit 0, 3 static pages generated, 12 dynamic API routes listed.tsconfig.jsonand no typecheck script.node --test --test-concurrency=4 test/*.test.jsover 17 test files: 221 tests, 221 passed, 0 failed, 0 cancelled, 0 skipped, 0 todo.npm run collect:pypi-countries -- --dryrun,npm run collect:pypi-countries -- fooandnpm run collect:pypi-countries -- --dry-run --fooexit 2 with the usage message.npm run collect:pypi-countries --dry-runis a dry run and writes no run status.npm run collect:pypi-countries --dryrunwrites the run statusskipped_no_credentials, which is the normal collection path.No pre-existing or load-related failures: the run had none.
Not included
None.
How to merge
Rebase and merge, so that each change stays its own commit on
main.